home *** CD-ROM | disk | FTP | other *** search
- /*
- * CBLibrary - err
- * Copyright (C) 2003 Chris Bazley
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
- /* Original version by Tony Houghton for !FormText
-
- Applications using this component need the following messages:
- FatErr, NewErr, OldErr, ErrButtons
- */
-
- #ifndef err_h
- #define err_h
-
- #include <stdbool.h>
- #include "kernel.h"
-
- #define err_check_fatal(func) { \
- _kernel_oserror *er = func; \
- if(er != NULL) { \
- err_check_fatal_rep(er); \
- } \
- }
- #define RE(func) { \
- _kernel_oserror *er = func; \
- if(er != NULL) { \
- err_check_rep(er); \
- } \
- }
-
- #define EF(func) err_check_fatal(func)
-
- #define E(func) err_check(func)
-
- extern void err_set_taskname(const char *name, bool new_errs);
-
- extern bool err_check(const _kernel_oserror *);
- extern void err_check_rep(const _kernel_oserror *);
- extern void err_check_fatal_rep(const _kernel_oserror *);
-
- extern void err_report(int, const char *); /* OK button only */
- extern void err_complain(int, const char *); /* Cancel & OK buttons */
- extern void err_complain_fatal(int, const char *); /* Cancel button only */
- extern void err_box_die(_kernel_oserror *);
-
- #endif
-